package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.TlPddGoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TlPddGoodsMapper;
import com.ruoyi.system.domain.TlPddGoods;
import com.ruoyi.system.service.ITlPddGoodsService;

/**
 * 拼多多商品列Service业务层处理
 *
 * @author lhs
 * @date 2023-11-07
 */
@Service
public class TlPddGoodsServiceImpl implements ITlPddGoodsService
{
    @Autowired
    private TlPddGoodsMapper tlPddGoodsMapper;

    /**
     * 查询拼多多商品列
     *
     * @param id 拼多多商品列主键
     * @return 拼多多商品列
     */
    @Override
    public TlPddGoods selectTlPddGoodsById(Long id)
    {
        return tlPddGoodsMapper.selectTlPddGoodsById(id);
    }

    /**
     * 查询拼多多商品列列表
     *
     * @param tlPddGoods 拼多多商品列
     * @return 拼多多商品列
     */
    @Override
    public List<TlPddGoodsVo> selectTlPddGoodsList(TlPddGoods tlPddGoods)
    {
        return tlPddGoodsMapper.selectTlPddGoodsList(tlPddGoods);
    }

    /**
     * 新增拼多多商品列
     *
     * @param tlPddGoods 拼多多商品列
     * @return 结果
     */
    @Override
    public int insertTlPddGoods(TlPddGoods tlPddGoods)
    {
        tlPddGoods.setCreateTime(DateUtils.getNowDate());
        return tlPddGoodsMapper.insertTlPddGoods(tlPddGoods);
    }

    //批量插入
    @Override
    public int insertTlPddGoodsAll(List<TlPddGoods> tlPddGoods) {
        return tlPddGoodsMapper.insertTlPddGoodsAll(tlPddGoods);
    }

    /**
     * 修改拼多多商品列
     *
     * @param tlPddGoods 拼多多商品列
     * @return 结果
     */
    @Override
    public int updateTlPddGoods(TlPddGoods tlPddGoods)
    {
        return tlPddGoodsMapper.updateTlPddGoods(tlPddGoods);
    }

    /**
     * 批量删除拼多多商品列
     *
     * @param ids 需要删除的拼多多商品列主键
     * @return 结果
     */
    @Override
    public int deleteTlPddGoodsByIds(Long[] ids)
    {
        return tlPddGoodsMapper.deleteTlPddGoodsByIds(ids);
    }

    /**
     * 删除拼多多商品列信息
     *
     * @param id 拼多多商品列主键
     * @return 结果
     */
    @Override
    public int deleteTlPddGoodsById(Long id)
    {
        return tlPddGoodsMapper.deleteTlPddGoodsById(id);
    }

    public int deleteTlPddGoodsByUserIdAndOwnerId(Long userId, Long ownerId)
    {
        return tlPddGoodsMapper.deleteTlPddGoodsByUserIdAndOwnerId(userId,ownerId);
    }

    @Override
    public int deleteTlPddGoodsByGoodsIds(Long[] goodsIds)
    {
        return tlPddGoodsMapper.deleteTlPddGoodsByGoodsIds(goodsIds);
    }


}
